<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/public.css" />
<script src="<?php echo APP_TEMPLATES_URL;?>/js/common.js" type="text/javascript" charset="utf-8"></script>

<style>
	body,
	html {
		background: #F4F4F4 !important;
	}
	
	.indexm {
		display: none;
	}

</style>
<script type="application/javascript">
	var key = getCookie("key");
	if (key) {
		//window.location.href = 'index.php';
	}
	function checkLogin() {
		var e = $("#username").val();
		var i = $("#userpwd").val();
		var ref_url='<?php echo $output['ref_url'];?>';
		var t = "wap";
		//alert(ref_url);return;
		if($.trim(e)=='' || $.trim(i)=='') {
			return;
		}
		$.ajax({
			type : "post",
			url :  "<?php echo APP_SITE_URL;?>/index.php?act=login&op=login",
			data : {
				username : e,
				password : i,
				client : t,
				ref_url:ref_url
			},
			dataType : "json",
			success : function(e) {
				a = true;
				if (!e.datas.error) {
					//alert('ok');
					//alert(e.datas.ref_url);return;
					if (typeof e.datas.key == "undefined") {
						return false
					} else {
						var i = 0;
						if ($("#checkbox").prop("checked")) {
							i = 188
						}
						addCookie("username", e.datas.username, i);
						addCookie("key", e.datas.key, i);
						//location.href = 'index.php';
						location.href = e.datas.ref_url;
					}
				} else {
					alert(e.datas.error)
				}
			}
		})
	}


</script>
<!-- 导航 -->

<div style="height: 10px;"></div>
<ul class="across">
	<li class="side notactive">
		<div class="countone">
			<label>
					<input class="username" type="text" id="username" style="font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="请输入手机号码" />
			</label>
			<label style="width: 36px; display: none;" class="username2"><a href="#" onclick="clearV('username')"><img style="width: 28px;" src="<?php echo APP_TEMPLATES_URL;?>/images/chacha.png" /></a></label>
		</div>
	</li>
	<li class="side notactive">
		<div class="countone">
			<label>
					<input type="password" id="userpwd" autocomplete="off" class="userpwd" style="font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="请输入密码" />
			</label>
			<label style="width: 36px; display: none;" class="userpwd2"><a href="#" onclick="clearV('userpwd')"><img style="width: 28px;" src="<?php echo APP_TEMPLATES_URL;?>/images/chacha.png"/></a></label>
		</div>
	</li>
</ul>

<style>	
			.loginbnt {
				font-size: 20px;
				line-height: 50px;
				color: #FFFFFF;
				background: #c0a063;
				float: left;
				text-align: center;
				width: 100%;
			}
			.loginbnt:active{
				background: #d8b167;
				color: #333333 !important;
				}
			.loginbnt:hover{color: #000000;}			
</style>

<div style="padding: 20px 15px; clear: both;">
	<table width="100%">
		<tr>
			<td colspan="2">
				<a href="#" onclick="checkLogin()" class="loginbnt">登录</a>
			</td>
		</tr>
		<tr>
			<td><!--<input id="checkbox" type="checkbox" checked="" style="-webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0) inset !important;"> <label for="checkbox">七天自动登录</label>--></td>
			<td style="text-align: left;padding-top: 12px;"><a href="index.php?act=login&op=findpassword">忘记密码？</a></td>
		</tr>
		<tr>
			<td colspan="2">
				<a href="index.php?act=temp&op=register" onclick="checkLogin()" class="loginbnt" style="background: #FFFFFF; color: #c0a063; border: 1px solid #c0a063 !important;    margin-top: 50px;">注册</a>
			</td>
		</tr>
	</table>
</div>
<script language="javascript">
<!--
  $('#userpwd').keydown(function(event){
	  var key_code = event.keyCode;
	  if (key_code==13){
		  checkLogin();
	  }
  });
-->
</script>